#ifndef _SKILLMGR_H
#define _SKILLMGR_H

#include "base/core/singleton.h"
#include <stdint.h>
#include <unordered_map>
#include <string>
#include <vector>
#include <list>
#include "base/core/point3.h"
#include "base/core/char_operation.h"
#include "Common/ComTypeDefine.h"

#include "Common/ComTypeDefine.h"
#include "base/core/memory_pool.h"
#include "SkillCommonDef.h"
#include "SkillBase.h"
#include "base/core/object_pool.h"
#include "SkillBullet.h"
#include "SkillFlash.h"
#include "SkillShadowStrike.h"
#include "SkillSummon.h"
#include "SkillTuXi.h"
#include "SkillChongZhuang.h"
#include "SkillGouzi.h"
#include "SkillRelive.h"
#include "SkillSomeSummon.h"
#include "SkillSomeBulletOnePointAoe.h"
#include "SkillSomePointDelayAoe.h"
#include "SkillMoveAOE.h"
#include "SkillShareDamage.h"
#include "SkillLockSomeTarget.h"

using namespace std;

class SkillMgr : public ManualSingleton<SkillMgr>
{
	friend class ManualSingleton<SkillMgr>;
	typedef unordered_map<uint32_t, SkillCfg> SkillCfgMap;
	typedef unordered_map<uint32_t, list<uint32_t> > NewSkillCharacterLevMap;
	typedef unordered_map<uint32_t, NewSkillCharacterLevMap> NewSkillCfgMap;

public:
	bool Init();
	bool Unit();
	void PrintMem();

	const SkillCfg* GetSkillCfg(uint32_t Id);
	const list<uint32_t> GetNewSkillLst(uint32_t profession, uint32_t characterLev);

	SkillMgr();
	~SkillMgr();
public:
	bool ParseFormulaParma(string str, VEC_INT32&vParam) const;
	bool ParseFormulaCol(string str, vector<VEC_INT32>&v) const;
	bool DebugLog();
protected:
	SkillCfgMap		 m_skillCfgMap;
	NewSkillCfgMap m_newSkillMap;

public:
	ObjectPool<SkillBase> * m_pBasePool;	//技能对像池
	ObjectPool<SkillBullet>  * m_pBulletPool;	//技能对像池
	ObjectPool<SkillShadowStrike> * m_pShadowPool;	//技能对像池
	ObjectPool<SkillFlash> * m_pFlashPool;	//技能对像池
	ObjectPool<SkillSummon>*  m_pSummonPool;	//技能对像池
	ObjectPool<SkillTuXi> * m_pTuXiPool;	//技能对像池
	ObjectPool<SkillChongZhuang>*  m_pChongZhungPool;	//
	ObjectPool<SkillGouzi>*  m_pGouziPool;	//
	ObjectPool<SkillRelive>*  m_pRelivePool;	//
	ObjectPool<SkillSomeSummon>*  m_pSomeSummonPool;	//
	ObjectPool<SkillMoveAOE> * m_pSkillMoveAoePool;	//
	ObjectPool<SkillSomeBulletOnePoineAoe>*  m_pSomeBulletOnePointPool;	//
	ObjectPool<SkillSomePointDelayAoe>*  m_pSomePointDelayAoePool;	//
	ObjectPool<SkillShareDamage> * m_pShareDamagePool;	//
	ObjectPool<SkillLockSomeTarget> * m_pLockTargetPool;
private:
};

#define g_MakeSkillMgr() (SkillMgr::Instance())
#define g_GetSkillMgr()  (SkillMgr::GetInstance())
#define g_DelSkillMgr()  (SkillMgr::Destroy())

#endif
